import { createRouter, createWebHistory } from 'vue-router'

import Layout from '@/layout/index.vue'

/**
 * Note: 路由配置项
 *
 * hidden: true                     // 当设置 true 的时候该路由不会再侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 * alwaysShow: true                 // 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 *                                  // 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 *                                  // 若你想不管路由下面的 children 声明的个数都显示你的根路由
 *                                  // 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由
 * redirect: noRedirect             // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
 * roles: ['admin', 'common']       // 访问路由的角色权限
 * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
 * meta : {
    noCache: true                   // 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
    icon: 'svg-name'                // 设置该路由的图标，对应路径src/assets/icons/svg
    breadcrumb: false               // 如果设置为false，则不会在breadcrumb面包屑中显示
    activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
  }
 */

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '',
            component: Layout,
            redirect: '/index',
            children: [
                {
                    path: '/index',
                    component: () => import('@/views/home.vue'),
                    name: 'Index',
                    meta: { title: '首页', breadcrumb: true}
                },
                {
                    path: '/coalStatistics',
                    component: () => import('@/views/coal/statistics.vue'),
                    name: 'CoalStatistics',
                    meta: { title: '煤场概览', breadcrumb: true}
                },
                /*
                {
                    path: '/coalRecord',
                    component: () => import('@/views/coal/record.vue'),
                    name: 'CoalRecord',
                    meta: { title: '盘煤记录', breadcrumb: true}
                },
                {
                    path: '/recordInfo',
                    redirect: '/coalRecord/info',
                    meta: { title: '盘煤记录', breadcrumb: true},
                    children: [
                        {
                            path: '/coalRecord/info',
                            component: () => import('@/views/coal/recordInfo.vue'),
                            name: 'RecordInfo',
                            meta: { title: '详情', breadcrumb: true},
                        }
                    ]
                },
                {
                    path: '/recordReport',
                    redirect: '/coalRecord/report',
                    meta: { title: '盘煤记录', breadcrumb: true},
                    children: [
                        {
                            path: '/coalRecord/report',
                            component: () => import('@/views/coal/report.vue'),
                            name: 'RecordReport',
                            meta: { title: '检测报告', breadcrumb: true},
                        }
                    ]
                },
                {
                    path: '/analyse',
                    component: () => import('@/views/coal/analyse.vue'),
                    name: 'Analyse',
                    meta: { title: '盘煤分析', breadcrumb: true}
                },
                {
                    path: '/statistics',
                    component: () => import('@/views/coal/statistics.vue'),
                    name: 'Statistics',
                    meta: { title: '盘煤记录', breadcrumb: true}
                },
                */
                //入场管理
                {
                    path: '/entrance',
                    meta: { title: '入场管理', breadcrumb: true},
                    children: [
                        {
                            path: '/entrancePlan',
                            component: () => import('@/views/entrance/plan.vue'),
                            name: 'EntrancePlan',
                            meta: { title: '来煤计划', breadcrumb: true}
                        },
                        {
                            path: '/entranceQuality',
                            component: () => import('@/views/entrance/quality.vue'),
                            name: 'EntranceQuality',
                            meta: { title: '来煤煤质', breadcrumb: true}
                        },
                        {
                            path: '/entranceRecord',
                            component: () => import('@/views/entrance/record.vue'),
                            name: 'EntranceRecord',
                            meta: { title: '来煤记录', breadcrumb: true},
                        },
                        {
                            path: '/entranceReport',
                            redirect: '/entranceRecord/report',
                            meta: { title: '来煤记录', breadcrumb: true},
                            children: [
                                {
                                    path: '/entranceRecord/report',
                                    component: () => import('@/views/entrance/report.vue'),
                                    name: 'EntranceReport',
                                    meta: { title: '检测报告', breadcrumb: true},
                                }
                            ]
                        },
                        {
                            path: '/entranceStats',
                            component: () => import('@/views/entrance/stats.vue'),
                            name: 'EntranceStats',
                            meta: { title: '来煤统计', breadcrumb: true}
                        },
                        {
                            path: '/entranceScale',
                            component: () => import('@/views/entrance/scale.vue'),
                            name: 'EntranceScale',
                            meta: { title: '皮带秤记录', breadcrumb: true}
                        },
                    ]
                },
                //入炉管理
                {
                    path: '/furnacee',
                    meta: { title: '入场管理', breadcrumb: true},
                    children: [
                        {
                            path: '/furnaceeQuality',
                            component: () => import('@/views/furnace/quality.vue'),
                            name: 'FurnaceQuality',
                            meta: { title: '入炉煤质', breadcrumb: true}
                        },
                        {
                            path: '/furnaceeExport',
                            redirect: '/furnaceeQuality/export',
                            meta: { title: '入炉煤质', breadcrumb: true},
                            children: [
                                {
                                    path: '/furnaceeQuality/export',
                                    component: () => import('@/views/furnace/export.vue'),
                                    name: 'FurnaceeExport',
                                    meta: { title: '导出', breadcrumb: true},
                                }
                            ]
                        },
                        {
                            path: '/furnaceeRecord',
                            component: () => import('@/views/furnace/record.vue'),
                            name: 'FurnaceRecord',
                            meta: { title: '入炉记录', breadcrumb: true}
                        },
                        {
                            path: '/furnaceeScale',
                            component: () => import('@/views/furnace/scale.vue'),
                            name: 'FurnaceScale',
                            meta: { title: '皮带秤记录', breadcrumb: true}
                        },
                    ]
                },
                
                //设施设备
                {
                    path: '/device',
                    meta: { title: '设施设备', breadcrumb: true},
                    children: [
                        {
                            path: '/device/control',
                            component: () => import('@/views/device/control.vue'),
                            name: 'DeviceControl',
                            meta: { title: '输煤程控', breadcrumb: true}
                        },
                        {
                            path: '/device/manage',
                            component: () => import('@/views/device/manage.vue'),
                            name: 'DeviceManage',
                            meta: { title: '设备管理', breadcrumb: true}
                        },
                        {
                            path: '/device/warning',
                            component: () => import('@/views/device/warning.vue'),
                            name: 'DeviceWarning',
                            meta: { title: '设备报警', breadcrumb: true}
                        },
                    ]
                },
                //统计分析
                {
                    path: '/statistic',
                    meta: { title: '系统管理', breadcrumb: true},
                    children: [
                        {
                            path: '/statistic/coalArrival',
                            component: () => import('@/views/statistic/coalArrival.vue'),
                            name: 'CoalArrival',
                            meta: { title: '来煤统计', breadcrumb: true}
                        },
                        {
                            path: '/statistic/furnace',
                            component: () => import('@/views/statistic/furnace.vue'),
                            name: 'Furnace',
                            meta: { title: '入炉统计', breadcrumb: true}
                        },
                        {
                            path: '/statistic/checkAnalyse',
                            component: () => import('@/views/statistic/checkAnalyse.vue'),
                            name: 'CheckAnalyse',
                            meta: { title: '盘煤结果分析', breadcrumb: true}
                        },
                        {
                            path: '/statistic/checkStatistic',
                            component: () => import('@/views/statistic/checkStatistic.vue'),
                            name: 'CheckStatistic',
                            meta: { title: '盘煤统计', breadcrumb: true}
                        },
                        {
                            path: '/statistic/device',
                            component: () => import('@/views/statistic/device.vue'),
                            name: 'Device',
                            meta: { title: '设备统计', breadcrumb: true}
                        },
                    ]
                },
                //系统管理
                {
                    path: '/system',
                    meta: { title: '系统管理', breadcrumb: true},
                    children: [
                        {
                            path: '/systemYard',
                            component: () => import('@/views/system/yard.vue'),
                            name: 'SystemYard',
                            meta: { title: '煤场管理', breadcrumb: true}
                        },
                        {
                            path: '/systemZone',
                            component: () => import('@/views/system/zone.vue'),
                            name: 'SystemZone',
                            meta: { title: '煤场分区', breadcrumb: true}
                        },
                        {
                            path: '/systemType',
                            component: () => import('@/views/system/type.vue'),
                            name: 'SystemType',
                            meta: { title: '煤种管理', breadcrumb: true}
                        },
                        {
                            path: '/systemBoiler',
                            component: () => import('@/views/system/boiler.vue'),
                            name: 'systemBoiler',
                            meta: { title: '锅炉管理', breadcrumb: true}
                        },
                        {
                            path: '/systemScale',
                            component: () => import('@/views/system/scale.vue'),
                            name: 'SystemScale',
                            meta: { title: '皮带秤管理', breadcrumb: true}
                        },
                        {
                            path: '/systemSupplier',
                            component: () => import('@/views/system/supplier.vue'),
                            name: 'SystemSupplier',
                            meta: { title: '供应商管理', breadcrumb: true}
                        },
                    ]
                },
                
                

            ]
        },
        // {
        //     path: '/',
        //     name: 'home',
        //     components: {
        //         default: Home,
        //         header: Header,
        //         side: Side
        //     },
        //     meta: { breadcrumb: '首页' }
        // },
        // {
        //     path: '/coalRecord',
        //     name: 'coalRecord',
        //     components: {
        //         default: () => import('../views/coal/record.vue'),
        //         header: Header,
        //         side: Side
        //     },
        //     meta: { breadcrumb: '盘煤记录' }
        // },
        // {
        //     path: '/recordInfo',
        //     name: 'recordInfo',
        //     components: {
        //         default: () => import('../views/coal/recordInfo.vue'),
        //         header: Header,
        //         side: Side
        //     },
        //     meta: { breadcrumb: '详情' }
        // },
        // {
        //     path: '/about',
        //     name: 'about',
        //     // route level code-splitting
        //     // this generates a separate chunk (About.[hash].js) for this route
        //     // which is lazy-loaded when the route is visited.
        //     component: () => import('../views/AboutView.vue')
        // }
    ]
})

export default router
